from constants.constants import RestartType, IsErrorType
from typing import List,Any,Dict

class DeviceStateRestart:
    def __init__(self, device_nums: List[str], type: RestartType):
        self.device_nums = device_nums
        self.type = type

class DeviceStateOffline:
    def __init__(self, device_nums: List[str]):
        self.device_nums = device_nums

class DeviceStateOfflineProfit:
    def __init__(self, device_nums: List[str], coin: str, card: str):
        self.device_nums = device_nums
        self.coin = coin
        self.card = card

class DeviceStatePortError:
    def __init__(self, device_nums: List[str], device_port: int, is_error: IsErrorType):
        self.device_nums = device_nums
        self.device_port = device_port
        self.is_error = is_error

class DeviceStateReq:
    def __init__(self, device_num: str, port_fields: List[str]):
        self.device_num = device_num
        self.port_fields = port_fields

class DeviceStateResp:
    def __init__(self, code: int, message: str, data: Any, timestamp: int):
        self.code = code
        self.message = message
        self.data = data
        self.timestamp = timestamp

class DeviceStateData:
    def __init__(self, is_online: bool, csq: int, connection_type: int, state: Dict[str, int], charge_mode: Dict[str, int], pay_amount: Dict[str, int], pay_used: Dict[str, int], time_total: Dict[str, int], time_used: Dict[str, int], charge_id: Dict[str, int], eq_used: Dict[str, int], current_power: Dict[str, int], start_time: Dict[str, str], rev_time: int):
        self.is_online = is_online
        self.csq = csq
        self.connection_type = connection_type
        self.state = state
        self.charge_mode = charge_mode
        self.pay_amount = pay_amount
        self.pay_used = pay_used
        self.time_total = time_total
        self.time_used = time_used
        self.charge_id = charge_id
        self.eq_used = eq_used
        self.current_power = current_power
        self.start_time = start_time
        self.rev_time = rev_time